<?php 
$sql ="select DISTINCT approvedoc.Content,approvedoc.IDApproveDoc, approvedoc.Tile, approvedoc.IDTypeDoc, approvedoc.IDEmployee, buying_document.document_id, buying_document.company,approvedoc.IDGroupApprove  
from approvedoc, buying_document 
where approvedoc.IDApproveDoc=buying_document.document_id 
and approvedoc.IDTypeDoc in (13,15) ";

$result=mysql_query($sql);
if(mysql_num_rows($result)){
	?>
	<table width="100%" border="1">
		<tr>
			<td><?php echo mysql_num_rows($result);?></td>
		</tr>
		<tr>
			<td>TT</td>
			<td>approvedoc.IDApproveDoc</td>
			<td>approvedoc.Tile</td>
			<td>content</td>
			<td>approvedoc.IDTypeDoc</td>
			<td>approvedoc.IDEmployee</td>
			<td>buy-iddoc</td>
			<td>buy-company</td>
			<td>idgroupapp</td>
		</tr>
	<?php 
	$i=1;
	while($row=mysql_fetch_array($result)){
		?>
		<tr>
			<td><?php echo $i;?></td>
			<td><?php echo $row[IDApproveDoc];?></td>
			<td><?php echo $row[Tile];?></td>
			<td><?php echo $row[Content];?></td>
			<td><?php echo $row[IDTypeDoc];?></td>
			<td><?php echo $row[IDEmployee];?></td>
			<td><?php echo $row[document_id];?></td>
			<td><?php echo $row[company];?></td>
			<td><?php echo $row[IDGroupApprove];?></td>
		</tr>
		<?php 
			/*mysql_query("delete from listapprove where listapprove.IDGroupApprove='".$row[IDGroupApprove]."'");
			mysql_query("delete from list_reference where list_reference.id_group='".$row[IDGroupApprove]."'");
			mysql_query("delete from buying_document where buying_document.document_id='".$row[IDApproveDoc]."'");
			mysql_query("delete from approvedoc where approvedoc.IDApproveDoc='".$row[IDApproveDoc]."'"); */
		$i++;
	}
	?>
	</table>
	<?php 
}else {
	echo "lỗi";
}

?>